package aes.general;

import java.io.Serializable;


/**
 * The Class FileSend. Class holds byte representation of file to be transfered via network,and it's description.
 *  Mainly will hold the Exam text representation,but suitable for any file.
 * 
 */
public class FileSend implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String Description=null;
	private String fileName=null;	
	private String ExamID=null;
	
	/**
	 * Gets the exam id.
	 *
	 * @return the examID
	 */
	public String getExamID() {
		return ExamID;
	}

	/**
	 * Sets the exam id.
	 *
	 * @param examID the examID to set
	 */
	public void setExamID(String examID) {
		this.ExamID = examID;
	}

	/**
	 * Gets the student id.
	 *
	 * @return the studentId
	 */
	public String getStudentId() {
		return StudentId;
	}

	/**
	 * Sets the student id.
	 *
	 * @param studentId the studentId to set
	 */
	public void setStudentId(String studentId) {
		this.StudentId = studentId;
	}

	private String StudentId=null;
	private int size=0;
	
	/** The Byte Array representation of file. */
	public  byte[] mybytearray;
	
	
	/**
	 * Inits the array.
	 *
	 * @param size the size
	 */
	public void initArray(int size)
	{
		mybytearray = new byte [size];	
	}
	
	/**
	 * Instantiates a new file send.
	 *
	 * @param fileName the file name
	 */
	public FileSend( String fileName) {
		this.fileName = fileName;
	}
	
	
	/**
	 * Gets the file name.
	 *
	 * @return the file name
	 */
	public String getFileName() {
		return fileName;
	}

	/**
	 * Sets the file name.
	 *
	 * @param fileName the new file name
	 */
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	
	/**
	 * Gets the size of Byte Array.
	 *
	 * @return the size
	 */
	public int getSize() {
		return size;
	}

	/**
	 * Sets the size of Byte Array.
	 *
	 * @param size the new size
	 */
	public void setSize(int size) {
		this.size = size;
	}

	/**
	 * Gets the Byte Array.
	 *
	 * @return the Byte Array 
	 */
	public byte[] getMybytearray() {
		return mybytearray;
	}
	
	/**
	 * Gets the Byte Array from specific index.
	 *
	 * @param i the start index of Array to return
	 * @return the Byte array
	 */
	public byte getMybytearray(int i) {
		return mybytearray[i];
	}

	/**
	 * Sets the Byte Array .
	 *
	 * @param mybytearray the new Byte Array
	 */
	public void setMybytearray(byte[] mybytearray) {
		
		for(int i=0;i<mybytearray.length;i++)
		this.mybytearray[i] = mybytearray[i];
	}

	/**
	 * Gets the description of file.
	 *
	 * @return the description
	 */
	public String getDescription() {
		return Description;
	}

	/**
	 * Sets the description of file.
	 *
	 * @param description the new description
	 */
	public void setDescription(String description) {
		Description = description;
	}	
}

